﻿
Ext.define('app.prm.project.Search', {
    extend: 'Ext.panel.Panel',
    reference: 'projectsearch',
    autoHeight: true,
    isTodo: false,
    initComponent: function () {
        var me = this;

        me.form = new Ext.form.Panel(
        {
            defaults: { anchor: '100%' },
            bodyStyle: 'padding:5px',
            defaultType: 'textfield',
            defaults: {
                anchor: '100%'
            },
            fieldDefaults: {
                labelWidth: 90,
                labelAlign: "right",
                flex: 1,
                margin: 6
            },
            items: [
                {
                    fieldLabel: '项目编号',
                    name: 'ProjectNo'
                },
                {
                    fieldLabel: '项目名称',
                    name: 'ProjectName'
                },
                {
                    fieldLabel: '产品号',
                    name: 'ProductNo'
                },
                { xtype: 'hiddenfield', name: 'phaseStatus', value: -1 },
                {
                    fieldLabel: '开始时间',
                    xtype: 'datefield', name: 'dts',
                    format: 'Y-m-d', value: Ext.Date.add(new Date(), Ext.Date.YEAR, -1)
                }, {
                    xtype: 'datefield', name: 'dte', fieldLabel: '截止时间',
                    format: 'Y-m-d', value: new Date()
                },
                 {
                     xtype: 'checkboxgroup',
                     fieldLabel: '项目状态',
                     //columns: 3,
                     layout: 'auto',
                     defaults: {
                         cls: 'inline_checkbox'
                     },
                     //vertical: true,
                     items: [
                      { boxLabel: localize('Ready'), name: 'status', inputValue: 50, checked: true },
                         { boxLabel: localize('Processing'), name: 'status', inputValue: 10, checked: true },
                         { boxLabel: localize('Complete'), name: 'status', inputValue: 20 },
                         { boxLabel: localize('Pause'), name: 'status', inputValue: 30, checked: true },
                         { boxLabel: localize('End'), name: 'status', inputValue: 40 }
                     ]
                 },
                 {
                     xtype: 'radiogroup',
                     fieldLabel: '我的收藏',
                     items: [{
                         boxLabel: '是', name: 'Fstatus', inputValue: 1
                     },
                     {
                         boxLabel: '否', name: 'Fstatus', inputValue: 0, checked: true
                     }]
                 }
            ],
            buttons: [
                {
                    text: '开始搜索',
                    handler: 'onStartSearch'
                },
                {
                    text: '清空条件',
                    handler: 'onClearSearch'
                }
            ]
        });

        me.items = [me.form];
        me.callParent(arguments);
    }
});